<template>
  <div>
    <nav id="nav" class="navbar navbar-expand-lg">
      <!--fixed-top-->
      <router-link to="/" class="navbar-brand text-dark font-weight-bold" style="font-size:50px">Gas</router-link>
      <button
        class="navbar-toggler"
        type="button"
        data-toggle="collapse"
        data-target="#navbarNav"
        aria-controls="navbarNav"
        aria-expanded="false"
        aria-label="Toggle navigation"
      >
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav ml-auto">
          <li class="nav-item active">
            <router-link to="/" class="nav-link text-dark font-weight-bold">
              主页
              <span class="sr-only">(current)</span>
            </router-link>
          </li>
          <li class="nav-item">
            <router-link
              :to="{name:'article',query:{type:0}}"
              class="nav-link text-dark font-weight-bold"
            >文章</router-link>
          </li>
          <li class="nav-item">
            <router-link
              :to="{name:'project',query:{type:1}}"
              class="nav-link text-dark font-weight-bold"
            >项目</router-link>
          </li>
          <li class="nav-item">
            <router-link to="/feedback" class="nav-link text-dark font-weight-bold">反馈</router-link>
          </li>
        </ul>
      </div>
    </nav>
    <div class="banner">
      <div class="container">
        <div class="row">
          <div class="col-lg-9 col-md-9 col-sm-9"></div>
          <div class="col-lg-3 col-md-3 col-sm-3">
            <form class="search" @submit.prevent>
              <input type="text" v-model="q" placeholder="请输入搜索内容..." />
              <button @click="$emit('Search',q)">
                <i aria-hidden="true" class="iconfont icon-sousuo"></i>
              </button>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "ListNav",
  components: {
    axios
  },
  data() {
    return {
      q: ""
    };
  }
};
</script>

<style scoped>
#nav {
  margin: auto;
  width: 60%;
}
.banner {
  width: 100%;
  height: 157px;
  background-color: #000;
  padding: 60px 0;
}
form {
  width: 100%;
  float: left;
  position: relative;
}
input[type="text"] {
  background-color: rgba(255, 255, 255, 0.3);
  border: 0;
  margin-top: 3px;
  height: 34px;
  padding: 0 10px;
  border-radius: 3px;
  color: white;
  width: 100%;
}
input[type="text"]::-webkit-input-placeholder {
  color: #ccc;
}
input::-moz-input-placeholder {
  color: #ccc;
}
input::-ms-input-placeholder {
  color: #ccc;
}
button {
  width: 15%;
  background-color: rgba(255, 255, 255, 0.3);
  border: 0;
  transition-duration: 0.2s;
  margin-top: 3px;
  height: 34px;

  position: absolute;
  right: 0;
}
</style>